/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package business;

/**
 * Account for Matching Search
 */
public class AccountOfMatch extends Account {
    private float matchScore;
    private int numOfCommonFriends;
    private float bestScore;
    
    public float getMatchScore() {
        return matchScore;
    }

    public void setMatchScore(float matchScore) {
        this.matchScore = matchScore;
    }
      
    public int getNumOfCommonFriends() {
        return numOfCommonFriends;
    }

    public void setNumOfCommonFriends(int numOfCommonFriends) {
        this.numOfCommonFriends = numOfCommonFriends;
    }

    public int getMatchPercent() {
        float percent = (matchScore/bestScore)*100;
        if (percent < 0) {
            percent = 10;
        } else if(percent > 100) {
            percent = 100;
        }
        return Math.round(percent);
    }

    public float getBestScore() {
        return bestScore;
    }
    
    public float getStarScore() {
        int matchPercent = getMatchPercent();
        float oddStarScore = matchPercent/20.0F;
        // round the oddStarScore at the first digit after dot
        float starScore = Math.round(oddStarScore*10)/10.0F;
        return starScore;
    }

    public void setBestScore(float bestScore) {
        this.bestScore = bestScore;
    }
}
